import request from '@/utils/request'

// 获取商品分类列表
export const getCategoryList = (data) => {
  return request({
    url: '/goodsCategory/list',
    method: 'get',
    params:data
  })
}

// 保存商品分类
export const addCategory = (data) => {
  return request({
    url: '/goodsCategory/edit',
    method: 'post',
    data: data
  })
}

// 删除商品分类
export const delCategory = (id) => {
  return request({
    url: '/goodsCategory/'+id,
    method: 'delete'
  })
}

// 修改商品分类
export const editCategory = (data) => {
  return request({
    url: '/goodsCategory/edit',
    method: 'put',
    data: data
  })
}

// 获取商品分类详情
export const getCategoryDetail = (id) => {
  return request({
    url: '/goodsCategory/'+id,
    method: 'get'
  })
}
